package es.capgemini.extjsplugin.ui;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;


/**
 * Contenedor de los controles para seleccionar clase, paquete y folders de los elementos a generar
 * @author Lisandro Medrano
 *
 */
public class ClassSelectionPanel extends org.eclipse.swt.widgets.Composite{
	private Text selectedClassName;
	
	private Class selectedClass;
	private String packageName;
	private String webFolderPath;
	private String package_url;
	private Label label1;
	private Button packageSelectionButton;
	private Button webFolderSelectButton;
	private Label label2;
	private Text webFolder;
	private Text paquete;
	
	public String getPackage_url() {
		return package_url;
	}

	public void setPackage_url(String packageUrl) {
		package_url = packageUrl;
	}

	public void setSelectedClass(Class selectedClass) {
		this.selectedClass = selectedClass;
	}

	public Class getSelectedClass() {
		return selectedClass;
	}

	private Label labelClass;
	

	public void setSelectedClass(Text selectedClass) {
		this.selectedClassName = selectedClass;
	}	
	public String getPackageName() {
		return packageName;
	}

	public void setPackageName(String packageName) {
		this.packageName = packageName;
	}

	public String getWebFolderPath() {
		return webFolderPath;
	}

	public void setWebFolderPath(String webFolderPath) {
		this.webFolderPath = webFolderPath;
	}

	public Text getSelectedClassName() {
		return selectedClassName;
	}

	public void setSelectedClassName(Text selectedClassName) {
		this.selectedClassName = selectedClassName;
	}

	public Text getWebFolder() {
		return webFolder;
	}

	public void setWebFolder(Text webFolder) {
		this.webFolder = webFolder;
	}

	public Text getPaquete() {
		return paquete;
	}

	public void setPaquete(Text paquete) {
		this.paquete = paquete;
	}

	private Button classSelectionButton;

	/**
	* Auto-generated main method to display this 
	* org.eclipse.swt.widgets.Composite inside a new Shell.
	*/
	
	/**
	* Overriding checkSubclass allows this class to extend org.eclipse.swt.widgets.Composite
	*/	
	protected void checkSubclass() {
	}
	
	/**
	* Auto-generated method to display this 
	* org.eclipse.swt.widgets.Composite inside a new Shell.
	*/

	public ClassSelectionPanel(org.eclipse.swt.widgets.Composite parent, int style) {
		super(parent, style);
		initGUI();
	}

	private void initGUI() {
		//TODO:Agregar autocompletar (Como en el wizard de new class de eclipse)
		//TODO:Cambiar el web selection dialog por el que corresponda
		try {
			this.setLayout(null);
			{
				selectedClassName = new Text(this, SWT.NONE);
				selectedClassName.setBounds(100, 20, 190, 20);
			}
			{
				labelClass = new Label(this, SWT.NONE);
				labelClass.setText("Clase Entidad");
				labelClass.setBounds(19, 20, 75, 20);
			}
			{
				classSelectionButton = new Button(this, SWT.PUSH | SWT.CENTER);
				classSelectionButton.setText("Browse");
				classSelectionButton.setBounds(302, 20, 79, 20);
				
			}
			{
				paquete = new Text(this, SWT.NONE);
				paquete.setBounds(100, 59, 190, 19);
			}
			{
				label1 = new Label(this, SWT.NONE);
				label1.setText("Package");
				label1.setBounds(20, 59, 68, 20);
			}
			{
				webFolder = new Text(this, SWT.NONE);
				webFolder.setBounds(100, 97, 190, 20);
			}
			{
				label2 = new Label(this, SWT.NONE);
				label2.setText("Web Folder");
				label2.setBounds(20, 97, 68, 20);
			}
			{
				webFolderSelectButton = new Button(this, SWT.PUSH | SWT.CENTER);
				webFolderSelectButton.setText("Browse");
				webFolderSelectButton.setBounds(302, 97, 79, 20);
				
				packageSelectionButton = new Button(this, SWT.PUSH | SWT.CENTER);
				packageSelectionButton.setText("Browse");
				packageSelectionButton.setBounds(302, 59, 79, 19);
				
			}
			this.layout();
			pack();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public Button getWebFolderSelectButton() {
		return webFolderSelectButton;
	}

	public void setWebFolderSelectButton(Button webFolderSelectButton) {
		this.webFolderSelectButton = webFolderSelectButton;
		{
			
		}
	}

	public Button getClassSelectionButton() {
		return classSelectionButton;
	}

	public void setClassSelectionButton(Button classSelectionButton) {
		this.classSelectionButton = classSelectionButton;
	}

	public Button getPackageSelectionButton() {
		return packageSelectionButton;
	}	

}
